#include "cm_drawable.hpp"
#include "ge_image.hpp"
#include "ge_vector2.hpp"
#include "cm_window.hpp"
#include "ge_color.hpp"

#include <stdexcept>
#include <iostream>
#include <fstream>

using namespace std;
using namespace ge;
using namespace cm;

int main() try {
  image star_img;
  ifstream png_file("../../media/weapons/star.png", ios::in | ios::binary);
  if(!png_file)
    throw runtime_error("Could not open file star.png");
  png_file >> star_img;
  
  color sky(0.0f, 0.0f, 1.0f);
  window main_window(sky);
  drawable test(vector2(0, 0), color(0.4f, 0.8f, 0.3f), 100.0f);
  main_window.add(test);
  main_window.start();
  
  return 0;
} catch(exception & e) {
  cerr << e.what() << endl;
} catch(...) {
  cerr << "An unknown error has occured." << endl;
}
